<template>
    <div>
        自定义指令
        <input type="text" v-focus>
        <p v-red>自定义指令变成红色</p>
        <p v-color="'green'">自定义指令传参</p>
    </div>
</template>

<script setup>

const vFocus = {
    mounted: (el) => {
        el.focus()
    }
}
const vRed = {
    mounted(el) {
        // console.log(el);
        el.style.color = 'red'
    }
}

const vColor = {
    mounted(el, binding) {
        el.style.color = binding.value

    }
}
</script>
<style scoped>

</style>